package com.swan.beans;

public enum RoleEnum {
    ADMIN(1), TEACHER(2), STUDENT(3);
    private int role;

    RoleEnum(int role) {
        this.role = role;
    }

    public int getRole() {
        return role;
    }

    public static final RoleEnum get(int i) {
        for (RoleEnum role : RoleEnum.values()) {
            if(role.role == i){
                return role;
            }
        }
        return null;
    }
}
